﻿using System.Collections;
using System.Collections.Generic;
using System.IO;
using UnityEngine;
using XLua;

namespace GFrame
{
    public static class LuaExport
    {
        public static LuaTable GetSysFiles(string path, string searchPattern, bool recursive)
        {
            LuaTable filesTable = LuaService.Instance.NewTable();
            List<string> files = FileService.Instance.GetFiles(path, searchPattern, recursive);
            for (int i = 0; i < files.Count; i++)
            {
                filesTable.Set(i + 1, files[i]);
            }
            return filesTable;
        }

        public static bool FileExists(string fileName)
        {
            return File.Exists(fileName);
        } 
    }
}

